import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: () => import('@/views/layout'),
    children: [{
      path: '',
      component: () => import('@/views/home')
    },
    {
      path: '/vidio',
      component: () => import('@/views/vidio')
    },
    {
      path: '/qa',
      component: () => import('@/views/qa')
    },
    {
      path: '/profile',
      component: () => import('@/views/profile')
    }]
  },
  // 登录页面路由
  { path: '/login', component: () => import('@/views/login') },
  // 搜索路由
  { path: '/search', component: () => import('@/views/search') },
  // 编辑资料
  { path: '/user', component: () => import('@/views/user') },
  // 文章详情页
  { path: '/article/:art_id', props: true, component: () => import('@/views/article') }

]

const router = new VueRouter({
  routes
})

export default router
